<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	/**
	 功能名称:图片批量导入
	 创建时间:2013-6-18
	 创建人:
	 **/
%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>图片批量导入</title>
		<link href="<%=path%>/css/index_css.css" rel="stylesheet" type="text/css" />
	
		<script type="text/javascript">
      
       function returnBack(){
      	window.location.href='<%=path%>/findAllUserByTypeAndStatusUserAction.action?user.userType=${param.paramUserType}&user.status=1';
      }
      
       function doSubmit(){
      	if(document.getElementById('file').value.length==0 || document.getElementById('file').value.substr(document.getElementById('file').value.indexOf('.')+1)!='zip'){
      		alert('请您选择要上传的.zip文件');
      		return;
      	}
      	document.myform.submit();
      	document.getElementById('buttonDiv').innerHTML="<img src=\"<%=path%>/images/jindu.gif\" width=\"30\" height=\"30\" align=\"absmiddle\" />正在导入...";
      }
      
       function changeType(chooseValue){
      	document.getElementById('chooseType').value=chooseValue;
      }
      
	</script>
	<!-- 表格样式控制 -->
	<style type="text/css">
.excel {
	background-color: #999;
	font-size: 13px;
}

.excel td {
	background-color: #fff;
	white-space: nowrap;
}

.excel th {
	background-color: #E7E7E7;
	font-weight: normal;
}
</style>
	</head>

	<body>
		<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">
			<tr>
					 <td height="25" align="right" valign="bottom" bgcolor="#ECE9D8"><img src="<%=path %>/images/bk_13.gif" width="18" height="18" align="absmiddle" /><a href="javascript:returnBack();">返回</a>&nbsp;&nbsp;&nbsp;<img src="<%=path %>/images/nv_hidden.gif" width="14" height="14" border="0" /> <a href="<%=path %>/template/batchAddImg.xls">下载导入用户模板</a>&nbsp;&nbsp;</td>
			</tr>
			<tr>
				<td align="center" valign="top" bgcolor="#ECE9D8">
					<table width="95%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td height="1" bgcolor="#ABA899"></td>
						</tr>
						<tr>
							<td height="1" bgcolor="#FFFFFF"></td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td height="25" align="center" valign="middle" bgcolor="#ECE9D8">
					<form name="myform" action="<%=path%>/batchAddImgUserAction.action" enctype="multipart/form-data" method="post">
						<input type="hidden" name="backURL" value="<%=path%>/findAllUserByTypeAndStatusUserAction.action?user.userType=${param.paramUserType}&user.status=1">
						<input id="chooseType" type="hidden" name="chooseType" value="NO">
						<table width="95%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td height="35" align="center" valign="bottom">
									<input id="file" name="file" type="file" size="45" />
								</td>
							</tr>
							<tr>
								<td height="35" align="center">
									<div id="buttonDiv">
										<input type="button" onclick="doSubmit();" name="Submit"
											value="提 交" />
									</div>
									&nbsp;&nbsp;&nbsp;
								</td>
							</tr>
						</table>
					</form>
				</td>
			</tr>
			<tr>
				<td height="25" align="left" valign="top" bgcolor="#ECE9D8"
					class="border_2">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td align="left" valign="top" class="tb_10 border_2">
								<table width="634" border="0" cellspacing="0" cellpadding="0" height="276">
									<tr>
										<td height="25" align="left" class="f_4">
											上传说明
										</td>
									</tr>
									<tr>
										<td height="120" align="left" valign="top">
											<div style="width: 610px; height: 100%;">
												上传必须为压缩文件，扩展名为.zip，压缩文件必须依照以下格式制作：
												<br>
												<br>
												1.一个名为batchAddImg.xls的Excel表格文件，表格格式如下：
												<br>
												<div style="margin-left: 130px;">
													<table class="excel" cellspacing="1" cellpadding="10" width="350" height="132">
														<tr>
															<th scope="col"></th>
															<th scope="col">
																A
															</th>
															<th scope="col">
																B
															</th>

														</tr>
														<tr>
															<th scope="row">
																1
															</th>
															<td align="center">
																用户编号
															</td>
															<td align="center">
																图片名称
															</td>
														</tr>
														<tr>
															<th scope="row">
																2
															</th>
															<td align="center">
																xxxxxx
															</td>
															<td align="center">
																ab.jpg
															</td>
														</tr>
													</table>
												</div>
												&nbsp;&nbsp;&nbsp;
												<br>
												2.若干个图片，扩展名称不限,每个图片与用户编号的映射记录在.xls表格里边。
												<br><br><font color="#ff0000">注：上传格式错误会导致上传失败</font><br>
												<br>
											</div>
										</td>
									</tr>

								</table>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td height="25" align="center" valign="middle" bgcolor="#ECE9D8"></td>
			</tr>
		</table>
	</body>
</html>
